1. Field of the Invention
This invention relates to sensing keys on a keypad and, more particularly, a method and apparatus for scanning a keypad or a keyboard using fewer pins than do current techniques.
2. Description of the Related Art
Keyboards and keypads are commonly associated with computing devices. However, they find application in a large variety of non-computing machines, as well. Exemplary, non-computing machines employing keypads include telephones, microwave ovens, and remote control units for consumer electronics. The array of machines employing keyboards and keypads is extensive and diverse, and ranges well beyond the computing machines with which they are commonly associated.
Virtually all these machines, both the computing and the non-computing, employ the same technique for determining when and which keys have been pushed. FIG. 1 depicts one implementation of this technique. Typically a switch matrix 10 is constructed, and the key switches 12 are placed at the intersections of rows 14 and columns 16. Each key switch 12 is a key and the switch matrix is the keyboard or keypad. Each key switch 12 is normally open, i.e., the key is not pushed, until it is closed when it is depressed, i.e., the key is pushed or pressed.
The machine associated with the switch matrix 10 determines whether a key has been pushed by xe2x80x9cinterrogatingxe2x80x9d the keys. The interrogation is typically conducted by an integrated circuit (not shown) that frequently, though not always, is programmable. The switch matrix 10 communicates with the integrated circuit through the integrated circuit""s pins. Pins are the typical interface between the internal circuitry of the integrated circuit and the circuitry with which the integrated circuit must interface. For instance, the integrated circuit""s circuitry must be powered, and the power is provided externally from a power supply that transmits a power signal to the internal circuitry through one of the integrated circuit""s pins.
Returning to FIG. 1, the keys 12 are interrogated by sending words, i.e., groups of digital 1s and 0s, to writable and readable registers (not shown) that control the integrated circuit""s pins (not shown). For example, the integrated circuit might write all 0s to the outputs of the rows 14 and read the inputs from the columns 16. If they are all high, i.e., a digital 1, no key is pushed. If any one is low, i.e., a digital 0, then at least one key is pushed. Often, some kind of protection is given in case more than one key is pushed at the same time. That could result in a conflict on a column, if one row is driving low and a different row is driving high, and both rows are connected to a certain column. In the implementation of FIG. 1, the drive to high is made resistive, so that excessive current will not flow.
This prior art key sensing scheme is effective at finding which key is pushed. However, it requires the integrated circuit to dedicate a number of pins on the order of (2xc3x97(square_root N), where N is the number of keys, solely for the purpose of determining whether a key has been pushed and identifying which key it is. The pin count is important because each pin costs money. If the integrated circuit is assembled into a package, usually the package cost goes up with the number of pins. An increased number of pins also increases design difficulty for an integrated circuit, which raises the cost of the integrated circuit when it is produced. Even if the integrated circuit is not packaged, each pin requires drivers and protection devices on the silicon, which take up die area, and also costs money.
Thus, there is a need for a new technique for determining whether a key on a keypad or a keyboard has been pushed and for identifing that key. The present invention is directed to resolving one or all of the problems mentioned above.
The invention is, in its various aspects, an apparatus and a method for scanning a keypad or a keyboard. The apparatus comprises a keypad and an integrated circuit. The keypad includes a plurality of chained resistors and a plurality of key switches. Each of the plurality of key switches is tied to a common node at a first terminal thereof and tapping the chained resistors at a second node thereof. Each of the key switches generates a signal indicative of the respective key switch being pressed when the key switch is pressed. The integrated circuit is capable of receiving the generated signal. The integrated circuit furthermore includes an analog to digital converter capable of generating a reference signal and a circuit capable of determining which key switch has been pressed from the magnitude of the generated voltage signal and the reference signal. The method for scanning a keypad generating a voltage signal whose magnitude indicates which key is being pressed, and determining from the magnitude of the generated voltage signal which key was pressed.